#include "door.h"
#include <QDebug>

Door::Door()
{
    init();
}

Door::Door(QRect &geometry) : FixedUnit(geometry)
{
    init();
}


Door::~Door()
{
}


void Door::init()
{
    m_sprite = "door1";
    loadPixmaps();
}

int Door::getType() const {return Unit::Door;}


void Door::draw(QPainter *painter)
{
    /*
    painter->fillRect(this->m_geometry, Qt::yellow);
    painter->setPen(Qt::white);
    painter->drawText(m_geometry.center().x(), m_geometry.center().y(), "D");
    */

    painter->drawPixmap(this->m_geometry, this->m_pixmaps[0][0]);
}


void Door::serializeDebug(QDebug &dbg)
{
    dbg << "Door : ";
    FixedUnit::serializeDebug(dbg);
}

void Door::serializeIn(QDataStream &in)
{
    FixedUnit::serializeIn(in);
    init();
}

void Door::serializeOut(QDataStream &out)
{
    FixedUnit::serializeOut(out);
}
